1. Technical Field of the Invention
The present invention relates to a magnetic sensor device and an electronic compass apparatus, and more particularly to calibration of a magnetic sensor.
2. Description of the Related Art
An electronic compass for detecting the Earth's magnetic field using a magnetic sensor and for measuring an orientation is conventionally provided in an in-vehicle navigation system, a mobile phone, or the like. When specifying the direction or magnitude of the Earth's magnetic field based on outputs of the magnetic sensor, it is necessary to perform calibration, which is a process for correcting the outputs of the magnetic sensor, in order to negate measurement errors caused by magnetization. A control value of this correction process is referred to as an “offset”. The offset is vector data indicating a magnetic field component caused by magnetization of a vehicle, a mobile phone, or the like detected by the magnetic sensor. Such measurement errors are negated by subtracting the offset from magnetic data output from the magnetic sensor. When a three dimensional (3D) magnetic sensor is used, it is possible to calculate the offset by obtaining the center of a sphere on which a set of magnetic data is distributed. Regarding an example of the prior art, reference is made to Japanese Patent Application Publication No. 2007-240270.
In order to maintain a correct offset, it is necessary to always activate an electronic compass control program and to always store a set of magnetic data as a statistical population for deriving the offset in a memory. However, if the electronic compass control program is always running, there is a problem in that excessive power is consumed to activate large-size electronic circuits including a CPU and memory. If the electronic compass control program is activated at the request of the user, it is possible to suppress power consumption. However, there is a problem in that it is not possible to measure a correct orientation when needed by the user since it takes a time to obtain a correct offset after the electronic compass control program is activated.